package experiment.e05.code.ch04.v3;

import experiment.e05.code.ch04.v0.Point;

/**
 * @author thinkpad - 83start
 * @version v1.0
 * @create 2022/10/13 16:40
 * @package experiment.e05.code.ch04.v3
 * @description 文件说明
 */

public class Test3 {
    public static void main(String[] args) {
        System.out.println("========== 测试 circle ==========");
        Point point = new Point(4, 7);
        Circle circle = new Circle(4, point);
        System.out.println(circle);

        System.out.println("\n========== 测试 rectangle ==========");
        Rectangle rectangle = new Rectangle(4, 2, point);
        System.out.println(rectangle);

        System.out.println("\n========== 测试 Shape 面积 ==========");
        Shape circleShape = circle;
        System.out.println("圆形的面积：" + circleShape.getArea());
        System.out.println("圆形的周长：" + circleShape.getC());

        Shape rectangleShape = rectangle;
        System.out.println("矩形的面积：" + rectangleShape.getArea());
        System.out.println("矩形的周长：" + rectangleShape.getC());
    }
}
